﻿<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">Ultralight Markup</asp:Content>

<asp:Content contentplaceholderid="HeadContent" runat="server">
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
	<p>Ultralight Markup is a stripped-down intermediate markup language meant to bridge the gap between text entry and HTML.  The primary objective is to allow very basic formatting while preventing invalid HTML entry and script injection.  This ASP.NET MVC project includes everything you need to get going.  It includes identical parsing engines in Javascript and C#.  And then there's a working editor with live preview and the Prettify syntax highlighter all integrated together.</p>

<form action="/submit" method="post">

<textarea name="comment" class="ultralight_editor" cols="30" rows="10">
Code can be entered `inline` within a sentence or as a code block...
    &lt;script type=&quot;text/javascript&quot;&gt;
      alert(&quot;hello world&quot;);
    &lt;/script&gt;

&gt; This is a quote spanning
&gt; two lines

Outside of code, you can also do the following:
- **bold**
- *italic*
- [link](http://www.bucketsoft.com)
...and obviously a list is possible
</textarea>

	<br />
	<input type="submit" value="Submit" style="font-size: 14pt" />
</form>

	<br /><br /><br /><br />
	<hr />
	<br /><br />

	<h3>Open Source Dependencies</h3>
	<ul>
		<li><a href="http://jurassic.codeplex.com/" target="_blank">Jurassic</a></li>
		<li><a href="http://jquery.com/" target="_blank">jQuery</a></li>
		<li><a href="http://code.google.com/p/google-code-prettify/" target="_blank">Prettify</a></li>
		<li><a href="http://hg.e-engura.org/jquerytextarea/" target="_blank">jQuery TextArea plugin</a> (slightly modified)</li>
	</ul>
	<br />

	<h3>Limitations</h3>
	<p>As you can see, the syntax is extremely basic.  It's actually a subset of Markdown.  Blockquotes and images are not supported.  Neither are headings, ordered lists, or even nested lists.</p>
	<p>If you're looking for more advanced formatting features I might suggest <a href="http://daringfireball.net/projects/markdown/" target="_blank">Markdown</a>.  Or take a look at the <a href="http://markitup.jaysalvat.com" target="_blank">MarkItUp editor</a> which supports a variety of markup languages.</p>
	<p>You should note, however, that my whole reason for creating this project in the first place was that I couldn't find a complete .NET solution for Markdown that would work without major flaws.  Even the MarkdownSharp project that StackOverflow uses is limited as it doesn't actually guarantee safe HTML.  To complicate things further, the editor they use has its own parsing engine separate from MarkdownSharp.  StackOverflow has obviously come up with a lot of custom solutions to solve all of these problems.  But since those solutions aren't tied together in a neat little open-source package, I decided to build something that was.</p>

	<!-- Include these javascript files in this order to enable the Ultralight editor and any TEXTAREA with class="ultralight_editor" will automatically be rendered when the page loads -->	
	<script type="text/javascript" src="/js/prettify/prettify.js"></script>
	<script type="text/javascript" src="/js/jquery.ultralight.editor.js"></script>
	<script type="text/javascript" src="/js/jquery.ultralight.markup.js"></script>

</asp:Content>
